package com.software.loginregister.api;

import com.software.loginregister.entity.Result;
import com.software.loginregister.entity.vo.UserFollowDTO;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface UserRelationApi {

    @POST("api/relations/toggle/{targetId}")
     Call<Result<Map<String, Object>>> toggleFollow(
        @Path("targetId") Long targetId,
        @Header("userId") Long userId
    );

    // 可选：检查是否已关注
    @GET("/api/relations/check/{targetId}")  // 添加前导斜杠
    Call<Result<Boolean>> checkFollowStatus(
        @Path("targetId") Long targetId,
        @Header("userId") String userId
    );

     @GET("/api/relations/followers/{userId}")
    Call<Result<List<UserFollowDTO>>> getFollowers(@Path("userId") Long userId);

    @GET("/api/relations/following/{userId}")
    Call<Result<List<UserFollowDTO>>> getFollowing(@Path("userId") Long userId);

}
